﻿@model IEnumerable<LetsDealData.Entities.Category>

@{
    ViewBag.Title = "Index";
}

<h2>Index</h2>

<p>
    @Html.ActionLink("Create New", "Create")
</p>

@using (Html.BeginForm())
{
    <p>Lựa chọn danh mục: @Html.DropDownList("selectedParent", "Danh mục chính")
    <input class="btn btn-primary" type="submit" value="Filter" /></p>
}

<table class="table table-striped full table-bordered dataTable" border="1" style="border-collapse:collapse;">
    <tr>
        <th scope="col">STT</th>
        <th scope="col">Tên danh mục</th>
        <th scope="col">Mô tả</th>
        <th></th>
    </tr>

    @{
        var i = 1;
    }

@foreach (var item in Model) {
    <tr>
        <td>@(i++)</td>
        <td>
            @Html.DisplayFor(modelItem => item.Name)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Description)
        </td>
        <td>
            @Html.ActionLink("Edit", "Edit", new { id=item.Id }) |
            @Html.ActionLink("Details", "Details", new { id=item.Id }) |
            @Html.ActionLink("Delete", "Delete", new { id=item.Id })
        </td>
    </tr>
}

</table>
